--CREATE SEQUENCE public."PharmacyRetailer_PharmacyRetailerId_seq";
CREATE TABLE public."PharmacyRetailer"
(
    "PharmacyRetailerId" integer NOT NULL DEFAULT nextval('"PharmacyRetailer_PharmacyRetailerId_seq"'::regclass),
	"RetailPharmacyId" integer,
    "AccountId" integer NOT NULL,
    "Active" boolean NOT NULL,
    "CreatedBy" integer NOT NULL,
    "CreatedDate" timestamp(6) without time zone NOT NULL,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp(6) without time zone,
    
    CONSTRAINT "PharmacyRetailer_pkey" PRIMARY KEY ("PharmacyRetailerId"),
    CONSTRAINT "FK_PharmacyRetailer_CreatedBy" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE,
    CONSTRAINT "FK_PharmacyRetailer_ModifiedBy" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE,
    CONSTRAINT "FK_PharmacyRetailer_AccountId" FOREIGN KEY ("AccountId")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE
 CONSTRAINT "FK_PharmacyRetailer_RetailPharmacyId" FOREIGN KEY ("RetailPharmacyId")
        REFERENCES public."RetailPharmacy" ("RetailPharmacyId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE
)